import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { BasicDataComponent } from './basic-data.component'
import { SiteManagementComponent } from './site-management/site-management.component'
import { WarehouseCompanyComponent } from './warehouse-company/warehouse-company.component'
import { RelatedPathComponent } from './related-path/related-path.component'
import { ElectronicLockComponent } from './electronic-lock/electronic-lock.component'
import { HandheldMachineComponent } from './handheld-machine/handheld-machine.component'
import { FixReaderComponent } from './fix-reader/fix-reader.component'
import { ContainerManagementComponent } from './container-management/container-management.component'
import { AppRouteGuard } from '@shared/common/auth/auth-route-app-guard';
import { CreateContainerPathComponent } from './container-management/create-container-path/create-container-path.component'

const routes: Routes = [

  {
    path: '',
    canActivate: [AppRouteGuard],
    canActivateChild: [AppRouteGuard],
    component: BasicDataComponent,
    data: { breadcrumb_no_url: 'base_data_config' },
    children: [
      {
        path: 'sites',
        component: SiteManagementComponent,
        data: { permission: 'A6_B15_', activeMenu: 'site', tabBelong: 'site', breadcrumb: 'site_manage' }
      },


      {
        path: 'warehouse',
        component: WarehouseCompanyComponent,
        data: { permission: 'A6_B16_', activeMenu: 'warehouse', tabBelong: 'warehouse', breadcrumb: 'company_manage' }
      },


      {
        path: 'equipment/electronicLock',
        component: ElectronicLockComponent,
        data: { permission: 'A6_B17_', activeMenu: 'equipment', tabBelong: 'equipment', breadcrumb: 'device_manage' }
      },
      {
        path: 'equipment/handheldMachine',
        component: HandheldMachineComponent,
        data: { permission: 'A6_B17_', activeMenu: 'equipment', tabBelong: 'equipment', breadcrumb: 'device_manage' }
      },
      {
        path: 'equipment/fixReader',
        component: FixReaderComponent,
        data: { permission: 'A6_B17_', activeMenu: 'equipment', tabBelong: 'equipment', breadcrumb: 'device_manage' }
      },
      {
        path: 'containers',
        component: ContainerManagementComponent,
        data: { permission: 'A6_B18_', activeMenu: 'container', tabBelong: 'container', breadcrumb: 'container_manage'  },
      },
      {
        path: 'containers/create',
        component: CreateContainerPathComponent,
        data: { permission: 'A6_B18_', activeMenu: 'container', tabBelong: 'container', breadcrumb: 'create_path' }
      }
    ],
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class BasicDataRoutingModule { }
